$OpenBSD: patch-cmake_modules_FindXscreensaver_cmake,v 1.6 2014/07/18 08:08:29 zhuk Exp $
--- cmake/modules/FindXscreensaver.cmake.orig	Thu Jan  2 23:44:58 2014
+++ cmake/modules/FindXscreensaver.cmake	Fri Feb 28 22:04:53 2014
@@ -5,6 +5,8 @@
 # Redistribution and use is allowed according to the terms of the BSD license.
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
 
+set(XSCREENSAVER_CHECK_ITEM zoom CACHE STRING "screen saver to check existence of")
+
 if (NOT XSCREENSAVER_FOUND)
   set(xscreensaver_alldirs)
   set(xscreensaver_checkdirs ${KDE4_INCLUDE_DIR}
@@ -25,10 +27,10 @@ bin/xscreensaver-hacks hacks)
         set(xscreensaver_alldirs ${xscreensaver_alldirs} ${xscreensaver_path}/${suffix})
      endforeach(xscreensaver_path ${xscreensaver_checkdirs} )
   endforeach(suffix lib${LIB_SUFFIX}/xscreensaver lib/xscreensaver lib64/xscreensaver libexec/xscreensaver bin/xscreensaver-hacks hacks)
-  FIND_PATH(XSCREENSAVER_DIR deco ${xscreensaver_alldirs})
+  FIND_PATH(XSCREENSAVER_DIR ${XSCREENSAVER_CHECK_ITEM} ${xscreensaver_alldirs})
 
   set(XSCREENSAVER_CONFIG_DIR)
-  FIND_PATH(XSCREENSAVER_CONFIG_DECO config/deco.xml
+  FIND_PATH(XSCREENSAVER_CONFIG_ITEM config/${XSCREENSAVER_CHECK_ITEM}.xml
     ${KDE4_INCLUDE_DIR}
     /usr/
     /usr/local/
@@ -38,6 +40,7 @@ bin/xscreensaver-hacks hacks)
     /opt/kde3/
     /usr/kde/
     /usr/share/xscreensaver/
+    /usr/local/share/xscreensaver/
     /usr/local/kde/
     /usr/local/xscreensaver/
     /usr/openwin/lib/xscreensaver/
@@ -45,15 +48,15 @@ bin/xscreensaver-hacks hacks)
   )
   #MESSAGE(STATUS "XSCREENSAVER_CONFIG_DIR :<${XSCREENSAVER_CONFIG_DIR}>")
 
-  if(XSCREENSAVER_CONFIG_DECO)
-	set(XSCREENSAVER_CONFIG_DIR "${XSCREENSAVER_CONFIG_DECO}/config/")
+  if(XSCREENSAVER_CONFIG_ITEM)
+	set(XSCREENSAVER_CONFIG_DIR "${XSCREENSAVER_CONFIG_ITEM}/config/")
 	#MESSAGE(STATUS "XSCREENSAVER_CONFIG_DIR <${XSCREENSAVER_CONFIG_DIR}>")
-  endif(XSCREENSAVER_CONFIG_DECO)
+  endif(XSCREENSAVER_CONFIG_ITEM)
 
 
   # Try and locate XScreenSaver config when path doesn't include config
   if(NOT XSCREENSAVER_CONFIG_DIR)
-    FIND_PATH(XSCREENSAVER_CONFIG_DIR deco.xml
+    FIND_PATH(XSCREENSAVER_CONFIG_DIR ${XSCREENSAVER_CHECK_ITEM}.xml
       /etc/xscreensaver
       )
   endif(NOT XSCREENSAVER_CONFIG_DIR)
